package com.eastcom.bm.atom;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "QA_DATASET_NE")
public class Atom_DatasetNe implements Serializable{

	private String id;
	
	private Atom_DatasetDefine datasetDefine;
	
	private Atom_PublicNe publicNe;

	@Id
	@Column(name = "ID", nullable = false)
	@GenericGenerator(name = "DatasetNe-uuid", strategy = "uuid")
	@GeneratedValue(generator = "DatasetNe-uuid")
	public String getId() {
		return id;
	}
	
	public void setId(String id) {
		this.id = id;
	}
	
	@ManyToOne(targetEntity=Atom_PublicNe.class,fetch=FetchType.EAGER,cascade={CascadeType.PERSIST})
	@JoinColumn(name="NE_ID",referencedColumnName="NE_ID")
	public Atom_PublicNe getPublicNe() {
		return publicNe;
	}

	public void setPublicNe(Atom_PublicNe publicNe) {
		this.publicNe = publicNe;
	}

	@ManyToOne(targetEntity=Atom_DatasetDefine.class,fetch=FetchType.EAGER,cascade={CascadeType.PERSIST})
	@JoinColumn(name="DATASET_ID",referencedColumnName="ID")
	public Atom_DatasetDefine getDatasetDefine() {
		return datasetDefine;
	}

	public void setDatasetDefine(Atom_DatasetDefine datasetDefine) {
		this.datasetDefine = datasetDefine;
	}
	
}
